package com.taomu.app.zongchouhuli.utils.banner;

import android.content.Context;
import android.media.Image;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.taomu.app.zongchouhuli.R;
import com.taomu.app.zongchouhuli.moudle.index.entity.BannerEntity;
import com.youth.banner.loader.ImageLoaderInterface;

public class CustomViewLoader implements ImageLoaderInterface<LinearLayout> {
    @Override
    public void displayImage(Context context, Object path, LinearLayout imageView) {
        final BannerEntity entity = (BannerEntity) path;
        ImageView img = imageView.findViewById(R.id.item_im);
        Glide.with(context).load(entity.getIcon()).into(img);
    }

    @Override
    public LinearLayout createImageView(Context context) {
        LinearLayout view = (LinearLayout)LayoutInflater.from(context).inflate(R.layout.custom_loader_view,null);
        return view;
    }
}
